package com.ytjj.qmyx.admin.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ytjj.common.api.CommonPage;
import com.ytjj.qmyx.admin.mapper.MessageClassifyMapper;
import com.ytjj.qmyx.admin.model.MessageClassify;
import com.ytjj.qmyx.admin.service.MessageClassifyService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class MessageClassifyServiceImpl implements MessageClassifyService {

    @Resource
    private MessageClassifyMapper messageClassifyMapper;

    @Override
    public CommonPage selectMessageClassifyPage(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        CommonPage page = CommonPage.restPage(messageClassifyMapper.selectMessageClassifyPage());
        return page;
    }

    @Override
    public MessageClassify selectMessageClassify(int id) {
        return messageClassifyMapper.selectMessageClassify(id);
    }

    @Override
    public int insertMessageClassify(MessageClassify messageClassify) {
        return messageClassifyMapper.insertMessageClassify(messageClassify);
    }

    @Override
    public List<MessageClassify> selectClassifyName() {
        return messageClassifyMapper.selectClassifyName();
    }

    @Override
    public int updateMessageClassify(MessageClassify messageClassify) {
        return messageClassifyMapper.updateMessageClassify(messageClassify);
    }
}
